﻿@model List<TJBHJJ.Models.Job>
@{
    ViewBag.Title = "招聘信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
    int pagecount = (int)ViewData["pageCount"];
    int pageindex = (int)ViewData["pageIndex"];
}
<h2>
    招聘信息</h2>
<table>
    <tr>
        <td>
            名字
        </td>
        <td>
            描述
        </td>
        <td>
            有效日期
        </td>
        <td>
            浏览次数
        </td>
    </tr>
    @foreach (var v in Model)
    {
        if (v != null)
        {
        <tr>
            <td>
                @Html.ActionLink(v.Name.Length > 13 ? v.Name.Substring(0, 13) : v.Name, "Detail", new { page = pageindex, id = v.Id })
            </td>
            <td>
                @(v.Content.Length > 30 ? v.Content.Substring(0, 20) + "..." : v.Content)
            </td>
            <td>@v.EndDateTime
            </td>
            <td>
                @v.ReadCount
            </td>
        </tr>
        }
    }
    <tr>
        <td colspan="3" align="center">
            @Html.ActionLink("[首页]", "Index", new { page = 0 })
            @for (int i = 1; i < pagecount; i++)
            {
                if (i == pageindex)
                {
                <strong style="color: Red;">@Html.ActionLink("[" + i + "]", "Index", new { page = i })</strong>
                }
                else
                {
                @Html.ActionLink("[" + i + "]", "Index", new { page = i })
                }
            }
            @Html.ActionLink("[末页]", "Index", new { page = pagecount })
        </td>
    </tr>
</table>
